package com.huawei.appmarket.service.externalservice.distribution.download;

import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;

public abstract class IDownloadCallback$Stub extends Binder implements IDownloadCallback {
    private static final String DESCRIPTOR = "com.huawei.appmarket.service.externalservice.distribution.download.IDownloadCallback";
    static final int TRANSACTION_getDownloadRegisterKey = 1;
    static final int TRANSACTION_refreshAppStatus = 2;

    static class d implements IDownloadCallback {
        private IBinder ˋ;

        d(IBinder iBinder) {
            this.ˋ = iBinder;
        }

        public IBinder asBinder() {
            return this.ˋ;
        }

        public String getDownloadRegisterKey() throws RemoteException {
            Parcel obtain = Parcel.obtain();
            Parcel obtain2 = Parcel.obtain();
            try {
                obtain.writeInterfaceToken(IDownloadCallback$Stub.DESCRIPTOR);
                this.ˋ.transact(1, obtain, obtain2, 0);
                obtain2.readException();
                String readString = obtain2.readString();
                return readString;
            } finally {
                obtain2.recycle();
                obtain.recycle();
            }
        }

        public void refreshAppStatus(String str, int i, int i2, int i3) throws RemoteException {
            Parcel obtain = Parcel.obtain();
            Parcel obtain2 = Parcel.obtain();
            try {
                obtain.writeInterfaceToken(IDownloadCallback$Stub.DESCRIPTOR);
                obtain.writeString(str);
                obtain.writeInt(i);
                obtain.writeInt(i2);
                obtain.writeInt(i3);
                this.ˋ.transact(2, obtain, obtain2, 0);
                obtain2.readException();
            } finally {
                obtain2.recycle();
                obtain.recycle();
            }
        }
    }

    public IDownloadCallback$Stub() {
        attachInterface(this, DESCRIPTOR);
    }

    public static IDownloadCallback asInterface(IBinder iBinder) {
        if (iBinder == null) {
            return null;
        }
        IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);
        if (queryLocalInterface == null || !(queryLocalInterface instanceof IDownloadCallback)) {
            return new d(iBinder);
        }
        return (IDownloadCallback) queryLocalInterface;
    }

    public IBinder asBinder() {
        return this;
    }

    public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
        String str = DESCRIPTOR;
        switch (i) {
            case 1:
                parcel.enforceInterface(str);
                str = getDownloadRegisterKey();
                parcel2.writeNoException();
                parcel2.writeString(str);
                return true;
            case 2:
                parcel.enforceInterface(str);
                refreshAppStatus(parcel.readString(), parcel.readInt(), parcel.readInt(), parcel.readInt());
                parcel2.writeNoException();
                return true;
            case 1598968902:
                parcel2.writeString(str);
                return true;
            default:
                return super.onTransact(i, parcel, parcel2, i2);
        }
    }
}
